package com.etc.controller;

import com.etc.entity.Building;
import com.etc.entity.CommentResult;
import com.etc.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BuildingController {
    @Autowired
    private BuildingService buildingService;
    @RequestMapping("building/update")
    public CommentResult update(@RequestBody Building building){
        System.out.println(building);
        int result = buildingService.updateBuilding(building);
        if (result>0)
            return new CommentResult(200,"success!");
        else {
            return new CommentResult(444, "failed!");
        }

    }
}
